package Day05作业;
/*
 * @Description: 
 * @Author: Aroma
 * @Date: 2024-09-11 19:48:03
 * @LastEditors: Aroma
 * @LastEditTime: 2024-09-11 20:08:13
 * @别瞎看: 你个无脑牛马
 */
public class Car {
    // 属性
    private String color;
    private String brand;
    private double price;

    // 构造方法
    public Car(String color, String brand, double price) {
        this.color = color;
        this.brand = brand;
        this.price = price;
    }

    // 前进
    public void moveForward() {
        System.out.println("Car is moving forward.");
    }

    // 后退
    public void moveBackward() {
        System.out.println("Car is moving backward.");
    }

    // 转弯
    public void turn() {
        System.out.println("Car is turning.");
    }

    // 输出对象属性信息
    public void displayInfo() {
        System.out.println("Car Color: " + color);
        System.out.println("Car Brand: " + brand);
        System.out.println("Car Price: " + price);
    }

    // Getter 和 Setter 方法（可选，但推荐）
    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
}